#ifndef RINGBUFFER_POLICIES_H
#define RINGBUFFER_POLICIES_H

struct InsertIgnorePolicy
{
protected:
	static bool handleOverflow(unsigned& start, const unsigned& size)
	{
		return true;
	}
};

struct InsertExceptionPolicy
{
protected:
	static bool handleOverflow(unsigned& start, const unsigned& size)
	{
		static char errorMessage[128];
		sprintf(errorMessage, "Out of Bounds Exception: Exceeded size of %u", size);
		throw errorMessage;
		return true;
	}

private:
};

struct InsertOverwritePolicy
{
protected:
	static bool handleOverflow(unsigned& start, const unsigned& size)
	{
		start = (start + 1) % size;
		return false;
	}
};

template<class T>
struct GetExceptionPolicy
{
protected:
	static bool handleEmpty(T& defaultValue)
	{
		throw "No Elements available!";
		return true;
	}
};

template<class T>
struct GetDefaultPolicy
{
protected:
	static bool handleEmpty(T& defaultValue)
	{
		defaultValue = GetDefaultPolicy<T>::defaultValue;
		return true;
	}

public:
	static T defaultValue;
};

template<class T>
T GetDefaultPolicy<T>::defaultValue;

#endif